cmake_minimum_required (VERSION 3.20)

# 一些选项
set(RUN_TEST OFF)
set(ATHOME OFF)

# 一些总的配置
if (RUN_TEST)
	set(CMAKE_CXX_STANDARD 20)
else()
	set(CMAKE_CXX_STANDARD 14)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
cmake_policy(SET CMP0091 NEW) 

# qt
if (ATHOME)
	set(CMAKE_TOOLCHAIN_FILE "D:/develop/vcpkg/scripts/buildsystems/vcpkg.cmake")
elseif (NOT ATHOME)
	set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.12.11/5.12.11/msvc2017_64/lib/cmake/Qt5")
	set(RUN_WINDEPLOYQT ON)
endif()

set(PROJECT_NAME qtsvg)
project (${PROJECT_NAME})

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakePredefinedTargets")

add_compile_options("$<$<CONFIG:DEBUG>:-DDEBUG>")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zc:__cplusplus")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zc:__cplusplus")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")

# sub dir
if (RUN_TEST)
add_subdirectory("unit_test")
endif()
add_subdirectory("xml")
add_subdirectory("svgeditor")
add_subdirectory("3rdparty")
